package com.hsj.feign.service;

import dto.TransData;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import pojo.User;

/**
 * @author:Teacher黄
 * @date:Created at 2020/01/01
 */
@Component
public class FeignServiceCallBack implements FallbackFactory<FeignService> {
    @Override
    public FeignService create(Throwable throwable) {
        return new FeignService() {
            @Override
            public String hello() {
                return "网络异常";
            }

            @Override
            public TransData getData(String userName) {
                return null;
            }

            @Override
            public TransData postData(String userName) {
                return null;
            }

            @Override
            public TransData postUser(User user) {
                return null;
            }
        };
    }
}
